package com.hkw.singlecityidpicker.areapickerview;

import android.content.Context;

import com.contrarywind.adapter.WheelAdapter;

import java.util.List;

public class AreaAdapter implements WheelAdapter<String> {

    Context context;
    List<AddressBean.CityBean.AreaBean> areaBeans;

    public AreaAdapter(Context context, List<AddressBean.CityBean.AreaBean> areaBeans) {
        this.context = context;
        this.areaBeans = areaBeans;
    }

    public void setAreaBeans(List<AddressBean.CityBean.AreaBean> areaBeans) {
        this.areaBeans = areaBeans;
    }

    @Override
    public int getItemsCount() {
        return areaBeans.size();
    }

    @Override
    public String getItem(int index) {
        return areaBeans.get(index).getLabel();
    }

    @Override
    public int indexOf(String o) {
        return 0;
    }
}
